<template>
    <el-card class="page-container">
        <template #header>
            <div class="header">
                <span>{{ title }}</span>
                <div class="extra">
                    <!-- 具名插槽 -->
                    <slot name="extra"></slot>
                </div>
            </div>
        </template>
        <!-- 默认插槽 -->
        <slot></slot>
    </el-card>
</template>
<script setup>
// 标题通过父传子
defineProps({
    title: {
        require: true,  //必须要传
        type: String   //字符串类型
    }
})
</script>
<style lang="scss" scoped>
.page-container {
    min-height: 100%;
    box-sizing: border-box;

    .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}
</style>